package com.syt.service.service;

import com.syt.service.dao.PhoneFacadeMapper;
import com.syt.service.pojo.PhoneFacade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author ：syt
 * @date ：Created in 2019-10-02 10:48
 * @description：外观信息服务类
 */
@Service
public class PhoneFacadeService {

    @Autowired(required = false)
    PhoneFacadeMapper mapper;

    /**
     * 删除根据id
     * @param facadeId
     * @return
     */
    public int deleteById(Integer facadeId) {
        return mapper.deleteByPrimaryKey(facadeId);
    }

    /**
     * 完全插入外观信息
     * @param facade
     * @return
     */
    public int insert(PhoneFacade facade) {
        return mapper.insert(facade);
    }

    /**
     * 选择插入外观信息数据
     * @param facade
     * @return
     */
    public int insertBySelective(PhoneFacade facade) {
        return mapper.insertSelective(facade);
    }

    /**
     * 根据id查询 外观信息
     * @param facadeId
     * @return
     */
    public PhoneFacade getById(Integer facadeId) {
        return mapper.selectByPrimaryKey(facadeId);
    }

    /**
     * 选择性更新 外观信息 数据
     * @param facade
     * @return
     */
    public int updateBySelective(PhoneFacade facade) {
        return mapper.updateByPrimaryKeySelective(facade);
    }

    /**
     * 完全更新 外观信息 数据
     * @param facade
     * @return
     */
    public int update(PhoneFacade facade) {
        return mapper.updateByPrimaryKey(facade);
    }

}
